package com.foreveross.fetl.core.domain.freight;

import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.dayatang.domain.InstanceFactory;
import com.foreveross.fetl.common.domain.BaseEntity;
import com.foreveross.fetl.core.domain.freight.repository.IOfficChannelSpreadRepository;

@Entity
@Table(name="offic_channel_spread")
public class OfficChannelSpreadEntity extends BaseEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = 5923324162880342129L;
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;
	
	//官网rowkey
	@Column(name="HBASE_KEY")
	private String hbaseKey;
	
	//渠道rowkey
	@Column(name="CHANNEL")
	private String channel;
	
	//出发城市三字码
	@Column(name="FROM_CITY")
	private String fromCity;
	
	//出发城市名称
	@Column(name="FROM_CITY_NAME")
	private String fromCityName;
	
	//到达城市三字码
	@Column(name="TO_CITY")
	private String toCity;
	
	 //到达城市名称
	@Column(name="TO_CITY_NAME")
	private String toCityName;
	
	
	//航班号
	@Column(name="FLIGHT_NO")
	private String flightNo;
	
	//官网价格
	@Column(name="HOME_PLACE")
	private Double homePrice;
	
	//渠道价格
	@Column(name="CHANNEL_PRICE")
	private Double channelPrice;
	
	//航班日期
	@Column(name="FLIGHT_DATE")
	private Date flightDate;
	
	//抓取时间
	@Column(name="GRAB_TIME")
	private Date grabTime;
	
	//统计日期
	@Column(name="REPORT_DATE")
	private Date reportDate;
	
	
	//渠道名称
	@Column(name="CHANNEL_NAME")
	private String channelName;
	
	@Column(name="HBASE_NAME")
	private String hbaseName;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getHbaseKey() {
		return hbaseKey;
	}

	public void setHbaseKey(String hbaseKey) {
		this.hbaseKey = hbaseKey;
	}

	public String getChannel() {
		return channel;
	}

	public void setChannel(String channel) {
		this.channel = channel;
	}

	public String getFromCity() {
		return fromCity;
	}

	public void setFromCity(String fromCity) {
		this.fromCity = fromCity;
	}

	public String getFromCityName() {
		return fromCityName;
	}

	public void setFromCityName(String fromCityName) {
		this.fromCityName = fromCityName;
	}

	public String getToCity() {
		return toCity;
	}

	public void setToCity(String toCity) {
		this.toCity = toCity;
	}

	public String getToCityName() {
		return toCityName;
	}

	public void setToCityName(String toCityName) {
		this.toCityName = toCityName;
	}

	public String getFlightNo() {
		return flightNo;
	}

	public void setFlightNo(String flightNo) {
		this.flightNo = flightNo;
	}

	public Double getHomePrice() {
		return homePrice;
	}

	public void setHomePrice(Double homePrice) {
		this.homePrice = homePrice;
	}

	public Double getChannelPrice() {
		return channelPrice;
	}

	public void setChannelPrice(Double channelPrice) {
		this.channelPrice = channelPrice;
	}

	public Date getFlightDate() {
		return flightDate;
	}

	public void setFlightDate(Date flightDate) {
		this.flightDate = flightDate;
	}

	public Date getGrabTime() {
		return grabTime;
	}

	public void setGrabTime(Date grabTime) {
		this.grabTime = grabTime;
	}

	
	
	
	public String getChannelName() {
		return channelName;
	}

	public void setChannelName(String channelName) {
		this.channelName = channelName;
	}

	public String getHbaseName() {
		return hbaseName;
	}

	public void setHbaseName(String hbaseName) {
		this.hbaseName = hbaseName;
	}

	public Date getReportDate() {
		return reportDate;
	}

	public void setReportDate(Date reportDate) {
		this.reportDate = reportDate;
	}

	public IOfficChannelSpreadRepository getIOfficChannelSpreadRepository(){
		return InstanceFactory.getInstance(IOfficChannelSpreadRepository.class);
	}
	
	public void removeList(List<OfficChannelSpreadEntity> list){
		getIOfficChannelSpreadRepository().removeList(list);
	}
	
	public int saveList(List<OfficChannelSpreadEntity> list) {
		return getIOfficChannelSpreadRepository().saveList(list);
	}
	
	public List<OfficChannelSpreadEntity> findByCondition(Date reportDate,
			Date flightDate, String fromCity, String toCity, String flightNo,
			String channel, String hbaseKey) {
		return getIOfficChannelSpreadRepository().findByCondition(reportDate,
				flightDate, fromCity, toCity, flightNo, channel, hbaseKey);
	}
	

}
